'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  // app.beforeStart(async () => {
  //   await app.model.sync({ alter: true });//force  false 为不覆盖 true会删除再创建; alter true可以 添加或删除字段;
  // });
  const { router, controller, io } = app;
  router.get('/', controller.home.index);
  // 获取账号信息
  router.get('/getAccountDetail', controller.accessPlatform.getAccountDetail);
  router.get('/getUserdetail', controller.accessPlatform.getUserdetail);
  router.get('/getRoledetail', controller.accessPlatform.getRoledetail);



  router.get('/movies', controller.movie.index);
  // 上传图片/头像/封面
  router.post('/tools/saveavatar', controller.article.saveAvatar);

  // app.io.route('deploy', app.io.controller.deploy.res);
  app.io.of('/').route('deploy', app.io.controller.deploy.res);
};
